<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/goals.css" rel="stylesheet">
  <title>记录<c:choose><c:when test="${week eq 0}">入营前</c:when><c:otherwise>第${week}周</c:otherwise></c:choose>体重体脂三围记录</title>
</head>
<body>
  <div class="page-group">
    <div class="page page-current">
      <header class="bar bar-nav fs-header-small">
        <a href="${ctx.host}/rounds/${courseRoundId}/result-report<c:choose><c:when test='${not empty scheduleId}'>?scheduleId=${scheduleId}</c:when><c:otherwise><c:if test='${not empty back}'>?back=${back}</c:if></c:otherwise></c:choose>" class="icon icon-left pull-left"></a>
        <h1 class="title">记录<c:choose><c:when test="${week eq 0}">入营前</c:when><c:otherwise>第${week}周</c:otherwise></c:choose>体重体脂三围</h1>
      </header>
      
      <div class="bar bar-footer">
        <a class="button save-button">保存</a>
      </div>
      
      <div class="content">
        <form action="${ctx.host}/rounds/${courseRoundId}/result-report/edit-bwh" method="POST">
          <div class="list-block" style="margin-bottom: 0px;">
            <input type="hidden" name="_method" value="PATCH" />
            <input type="hidden" name="week" value="${week}" />
            
            <div class="content-block-title">体重体脂三围数据</div>
            <ul class="bwh-edit-box">
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title" style="width: 5rem;">体重(KG)</div>
                  <div class="item-input">
                    <input type="text" name="weight" placeholder="请输入体重" value="<fmt:formatNumber value='${bwhRecord.weight}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>">
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title" style="width: 5rem;">体脂率(%)</div>
                  <div class="item-input">
                    <input type="text" name="bodyFatRate" placeholder="请输入体脂率" value="<fmt:formatNumber value='${bwhRecord.bodyFatRate}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>">
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title" style="width: 5rem;">胸围(CM)</div>
                  <div class="item-input">
                    <input type="text" name="bust" placeholder="请输入胸围" value="<fmt:formatNumber value='${bwhRecord.bust}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>">
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title" style="width: 5rem;">腰围(CM)</div>
                  <div class="item-input">
                    <input type="text" name="waist" placeholder="请输入腰围" value="<fmt:formatNumber value='${bwhRecord.waist}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>">
                  </div>
                </div>
              </li>
              <li class="item-content">
                <div class="item-inner">
                  <div class="item-title" style="width: 5rem;">臀围(CM)</div>
                  <div class="item-input">
                    <input type="text" name="hips" placeholder="请输入臀围" value="<fmt:formatNumber value='${bwhRecord.hips}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber>">
                  </div>
                </div>
              </li>
            </ul>
            
            <div class="content-block-title">备注</div>
            <ul class="bwh-edit-box">
              <li>
                <div class="item-content">
                  <div class="item-inner">
                    <div class="item-input">
                      <textarea name="remark" rows="4" cols="2" placeholder="请添加备注">${bwhRecord.remark}</textarea>
                    </div>
                  </div>
                </div>
              </li>
            </ul>
            
            <button type="submit" class="submit-btn" style="display: none;"></button>
          </div>
        </form>
      </div>
    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/result/bwh-edit.js" />
  <script type="text/javascript">
    require(['page/result/bwh-edit'], function(page) {
      page.init({
        'courseRoundId': '${courseRoundId}'
      });
    })
  </script>
</body>
</html>